/**=========================================================
 * Directive: baidu-map.js
 =========================================================*/

App.directive('baiduMap', ["$timeout", 'Utils',
    function($timeout, utils) {
        'use strict';
        
        return {
            restrict: 'EA',
            link: function($scope, $element, $attrs){
                var map = new BMap.Map($attrs.id);
                $scope[utils.isEmpty($attrs.name) ? 'baiduMap' : $attrs.name] = map;
            }
        };
    }
]);
